/**
 * @file     fizzBuzz.ts
 * @brief    [412. Fizz Buzz](https://leetcode.cn/problems/fizz-buzz/description/)
 * @author   Zhu
 * @date     2022-11-02 22:54
 */

function fizzBuzz(n: number): string[] {
    const result: string[] = [];
    for (let i = 1; i <= n; i++) {
        let cur = '';
        if (i % 3 === 0) cur += 'Fizz';
        if (i % 5 === 0) cur += 'Buzz';
        if (cur.length === 0) cur += i;
        result.push(cur);
    }

    return result;
}
